package com.lm.paymentadmin.service;

import com.alibaba.excel.EasyExcel;
import com.lm.paymentadmin.domain.Organization;
import com.lm.paymentadmin.excel.OrganizationExcelListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class ExcelService {
    @Resource
    private JdbcTemplate jdbcTemplate;

    public void readExcel(){
        String fileName = "/Users/liuming/Downloads/kk.xls";
        EasyExcel.read(fileName, Organization.class, new OrganizationExcelListener(jdbcTemplate)).sheet(0).doRead();
    }

}
